#ifndef __PLATFORM_OPROPERTY_H__
#define __PLATFORM_OPROPERTY_H__

namespace platform
{
	class oUnit;

	typedef delegate<void (oUnit* owner, float oldValue, float newValue)> oPropertyHandler;

	class oDLL oProperty: public CCObject
	{
	public:
		oProperty(oUnit* owner, float data);
		oProperty(const oProperty& prop);
		/** Change its value and not let others know. */
		oUnit* getOwner() const;
		void reset(float value);
		void operator=(float value);
		void operator+=(float value);
		void operator-=(float value);
		void operator=(const oProperty& prop);
		void operator+=(const oProperty& prop);
		void operator-=(const oProperty& prop);
		bool operator==(const oProperty& prop);
		bool operator!=(const oProperty& prop);
		operator float() const;
		/** Change its value and notice others. */
		oPropertyHandler changed;
	private:
		oUnit* _owner;
		float _data;
	};
}

#endif